<!doctype html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title><?php echo $title_for_layout; ?></title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,800italic,400,700,800' rel='stylesheet' type='text/css'>
        <?php echo $this->Html->css(array('bootstrap.min.css', 'css.css')); ?>
        <link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css" />
        <?php echo $this->Html->css("/css/font-awesome.min.css"); ?>
        <?php //echo $this->App->js(); ?>
        <?php echo $this->fetch('meta'); ?>
        <?php echo $this->fetch('css'); ?>
    </head>
    <body>
        <div class="container-fluid">
            <div class="col-md-3">        
                <a class="navbar-brand" href="<?php echo $this->Html->url('/'); ?>"><?php echo $this->Html->image('/img/logo_branco.png') ?></a>
            </div>
            <div class="col-md-9 text-right" style="margin-right: 0px;">
                <div class="col-xs-12">
                    <span style="background: none repeat scroll 0% 0% #EE0057; padding: 5px; margin-top: 2px; position: absolute; right: 0px; border: 0; border-radius: 5px;">
                        <?php
                        if ($this->Session->read('Auth.User.role') == 'customer') {
                            echo $this->Html->link(__('Olá ' . $this->Session->read('Auth.User.name')), array('controller' => 'users', 'action' => 'logout'), array('style' => 'color: #000;'));
                        } else {
                            echo $this->Html->link(__('Faça seu Login ou Cadastre-se'), array('controller' => 'shop', 'action' => 'login'), array('style' => 'color: #000;'));
                        }
                        ?>

                    </span>
                </div>
                <div class="col-xs-12 text-right" style="margin-top: 125px; margin-right: 0px;">
                    <div class="col-xs-12 col-md-10">
                        <?php echo $this->element('search'); ?>
                    </div>
                    <div class=" col-xs-12 col-md-2">        
                        <?php echo $this->element('list_cart'); ?>
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>
            <div class="navbar navbar-inverse" role="navigation">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>                
                    </div>
                    <div class="collapse navbar-collapse navbar-ex1-collapse">
                        <ul class="nav navbar-nav">
                            <li>
                                <?php echo $this->Html->link(__('Home'), array('controller' => 'products', 'action' => 'view')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link(__('Products'), array('controller' => 'products', 'action' => 'products')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link(__('Brands'), array('controller' => 'brands', 'action' => 'index')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link(__('Categories'), array('controller' => 'categories', 'action' => 'index')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link(__('Search'), array('controller' => 'products', 'action' => 'search')); ?>
                            </li>
                        </ul>

                    </div>
                </div>
            </div>
        </div>
        <div class="container-fluid">
            <!-- Carousel -->
            <?php //echo $this->element('Banners.widget_banners_carrocel'); ?>
            <div id="myCarousel" class="carousel slide">
                <div class="carousel-inner">
                    <div class="item active">
                        <?php echo $this->Html->image('/img/banner-1244x336.jpg') ?>
                    </div>
                    <div class="item">
                        <?php echo $this->Html->image('/img/banner-1244x336.jpg') ?>
                    </div>

                </div>
                <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
                <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>
            </div>
            <!-- /.carousel -->
        </div>
        <div class="clearfix"></div>
        <div style="padding-bottom: 20px;"></div>
        <div class="content">
            <div class="container-fluid">
                <?php echo $this->Session->flash(); ?>
                <ul class="breadcrumb">
                    <?php echo $this->Html->getCrumbs(' / '); ?>
                </ul>
                <?php echo $this->fetch('content'); ?>
            </div>
        </div>        
        <div class="footer">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-3">
                        <a href="<?php echo $this->Html->url('/'); ?>"><?php echo $this->Html->image('/img/logo_branco.png') ?></a>
                    </div>
                    <div class="col-md-3">
                        <ul>
                            <li>
                                <?php echo $this->Html->link(__('Home'), array('controller' => 'products', 'action' => 'view')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link(__('Products'), array('controller' => 'products', 'action' => 'products')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link(__('Brands'), array('controller' => 'brands', 'action' => 'index')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link(__('Categories'), array('controller' => 'categories', 'action' => 'index')); ?>
                            </li>
                            <li>
                                <?php echo $this->Html->link(__('Search'), array('controller' => 'products', 'action' => 'search')); ?>
                            </li>
                        </ul>
                    </div>
                    <div class="col-md-6">
                        <?php echo $this->element('search') ?>
                        &nbsp;                
                    </div>
                </div>
                <div class="row">
                    &copy; <?php echo date('Y'); ?> <?php echo env('HTTP_HOST'); ?>            
                </div>
            </div>
            <div class="debug">
                <?php echo $this->element('sql_dump'); ?>
            </div>           
        </div>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
        <?php echo $this->Html->script('/js/bootstrap.min.js'); ?>
        <!--[if lt IE 9]><?php echo $this->Html->script(array('html5shiv.js', 'respond.min.js')); ?><![endif]-->
        <?php echo $this->fetch('script'); ?>
        <?php if ($this->Session->check('Shop')) : ?>
            <script type="text/javascript">
                $(document).ready(function () {
                    $('#cartbutton').show();
                });
            </script>
        <?php endif; ?>
    </body>
</html>
